#{extends 'admintemplate.html' /}
#{set title:'Edit Product' /}
#{set active:'active' /}

#{set main_title:'Quản Lý Sản Phẩm'/}
#{set sub_title:'Thêm/Xóa/Sửa Sản Phẩm'/}
#{set 'moreScripts'}
      <script src="@{'/public/admin/js/bootstrap-modal.js'}" type="text/javascript"></script>
#{/set}
<div class="span12" style="width: 960px!important;">
	<div style="padding: 16px 19px;" class="well">
		<form class="form" enctype="multipart/form-data" method="post" action="/admin/editProduct" id="editProductForm">
			<fieldset>
				<div class="clearfix">
					<div class="input">
						<h2 style="color: red;">Edit Product</h2>
					</div>
				</div>
				<div class="clearfix">
					<label for="name">Name</label>
					<div class="input">
						<input type="text" name="name" value="${product?.name}">
					</div>
				</div>
				<div class="clearfix">
					<label for="data">Image File</label>
					<div class="input">
						<input type="file" name="image">
					</div>
				</div>
				
				<div class="clearfix">
					<label for="description">Description Short</label>
					<div class="input">
						<textarea name="descShort" cols="200" rows="5">${product?.descShort}</textarea>
					</div>
				</div>
				
				<div class="clearfix">
					<label for="description">Description Detail</label>
					<div class="input">
						<textarea name="descDetail" cols="200" rows="5">${product?.descDetail}</textarea>
					</div>
				</div>

				<div class="clearfix">
					<label for="selectbox">Category</label>
					<div class="input">
						<select name="category">
							#{list items: categories, as:'category'}
								<option value="${category?.alias}">${category?.name}</option>
							#{/list}
						</select>
					</div>
				</div>

				<input type="hidden" name="productId" value="${product?.id}">
				<div class="actions">
					<input type="submit" value="Cập nhật" class="btn primary">
				</div>
			</fieldset>
		</form>
	</div>
</div>
